home *** CD-ROM | disk | FTP | other *** search
/ Geek Games #12 / GEGA012.iso / Jogos de Azar / flash_poker.swf / scripts / frame_20 / DoAction.as
Text File  |  2006-01-17  |  1KB  |  70 lines

  1. Flush = "0";
  2. Straight = "0";
  3. HStraight = "0";
  4. WinStatus = "0";
  5. ii = "1";
  6. while(ii < "14")
  7. {
  8.    kk = "1";
  9.    while(kk < "5")
  10.    {
  11.       X = "1";
  12.       while(X < "6")
  13.       {
  14.          if(eval("Hand" add X) == "53")
  15.          {
  16.             set("CValue" add X,ii);
  17.             set("CSuit" add X,kk);
  18.          }
  19.          else
  20.          {
  21.             CardValue = eval("Hand" add X);
  22.             call("GetSuitCard");
  23.             set("CValue" add X,Card);
  24.             set("CSuit" add X,Suit);
  25.          }
  26.          X += "1";
  27.       }
  28.       call("SortValues");
  29.       if(!Flush)
  30.       {
  31.          Flush = CSuit1 == CSuit2 and CSuit2 == CSuit3 and CSuit3 == CSuit4 and CSuit4 == CSuit5;
  32.       }
  33.       if(!Straight)
  34.       {
  35.          Straight = CValue1 + "1" == CValue2 and CValue2 + "1" == CValue3 and CValue3 + "1" == CValue4 and CValue4 + "1" == CValue5;
  36.       }
  37.       if(!HStraight)
  38.       {
  39.          HStraight = CValue1 == "1" and CValue2 == "10" and CValue3 == "11" and CValue4 == "12" and CValue5 == "13";
  40.       }
  41.       call("IsKind");
  42.       T = IsKind;
  43.       if(WinStatus < T)
  44.       {
  45.          WinStatus = T;
  46.       }
  47.       kk += "1";
  48.    }
  49.    ii += "1";
  50. }
  51. if(WinStatus < "3")
  52. {
  53.    if(HStraight and Flush)
  54.    {
  55.       WinStatus = "9";
  56.    }
  57.    else if(Straight and Flush)
  58.    {
  59.       WinStatus = "7";
  60.    }
  61.    else if(HStraight or Straight)
  62.    {
  63.       WinStatus = "4";
  64.    }
  65.    else if(Flush)
  66.    {
  67.       WinStatus = "3";
  68.    }
  69. }
  70.